<script setup>
import {useRouter} from 'vue-router'
import {ref} from 'vue'

let myPath = ref('')
let router = useRouter()

function fun1() {
  router.push({
    path: myPath.value
  })
}

</script>

<template>
  <div>
    <router-link to="/list">跳到list</router-link>
    <router-link to="/home">跳到home</router-link><br>
    <button @click="fun1()">跳到detail</button>
    <input v-bind:type="'text'" v-model="myPath" />

    <router-view></router-view>
    <hr>
    <router-view name="homeView"></router-view>
  </div>
  
</template>

<style scoped> 

</style>
